import { RouteConfig } from "vue-router";
import Layout from "@/layout/index.vue";
import { AuthModule } from "@/store/modules/auth";

const resourceRouter: RouteConfig = {
  path: "/resource",
  component: Layout,
  redirect: "/resource/pool",
  name: "Resource",
  meta: {
    title: "resource",
    authrole: 'system_admin',
    routerRuleName: "Resource"
  },
  children: [
    {
      path: "pool",
      component: () => import("@/views/resource/pool.vue"),
      name: "ResourcePool",
      meta: {
        title: "resource",
        noCache: true,
        authrole: 'system_admin',
        routerRuleName: "ResourcePool"
      }
    },
    {
      path: "horizon",
      component: () => import("@/views/resource/horizon.vue"),
      name: "ResourceHorizon",
      meta: {
        title: "resourceHorizon",
        noCache: true,
        hidden: true
      }
    },
    {
      path: "daas",
      component: () => import("@/views/resource/daas.vue"),
      name: "ResourceDaas",
      meta: {
        title: "resourceDaas",
        noCache: true,
        hidden: true
      }
    },
    {
      path: "pool_detail",
      component: () => import("@/views/resource/pool_detail.vue"),
      name: "PoolDetail",
      meta: {
        title: "poolDetail",
        noCache: true,
        hidden: true,
        type: "/resource/pool"
      }
    },
    {
      path: "horizon_detail",
      component: () => import("@/views/resource/horizon_detail.vue"),
      name: "HorizonDetail",
      meta: {
        title: "horizonDetail",
        noCache: true,
        hidden: true,
        type: "/resource/pool"
      }
    },
    {
      path: "daas_detail",
      component: () => import("@/views/resource/daas_detail.vue"),
      name: "DaasDetail",
      meta: {
        title: "DaasDetail",
        noCache: true,
        hidden: true,
        type: "/resource/pool"
      }
    }
  ]
};

export default resourceRouter;
